Skip to content

Replace the deprecated add_event_pair with add_cleanup_event and add_event - #3225

Draft
ndgrigorian wants to merge 1 commit into
drop-host-tasks-and-reuse-dpctl-deferralfrom
replace-add-event-pair
Draft

ndgrigorian wants to merge 1 commit into
drop-host-tasks-and-reuse-dpctl-deferralfrom
replace-add-event-pair

Conversation

@ndgrigorian

@ndgrigorian ndgrigorian commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

This PR replaces every call to the order manager's add_event_pair, which dpctl 0.24.0dev0 deprecated (IntelPython/dpctl#2359), with add_cleanup_event and add_event. It is stacked on #3224.

With #3224, the first event an extension returns is that of the empty kernel gating the release of its arguments, not a host task. Each _manager.add_event_pair(ht_ev, ev) becomes _manager.add_cleanup_event(ht_ev) followed by _manager.add_event(ev), which record the same events in the same lists. The 314 calls in 34 files were rewritten with a script working on the AST, so the arguments are unchanged, and dpnp/AGENTS.md now describes the new calls. The ht_ev-style variable names are left as they are.

The full suite passes with it on a Level Zero iGPU (0x7d41, WSL). Each call now takes the order manager's lock and prunes completed events twice instead of once; this wasn't measured.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

…event

dpctl 0.24.0dev0 deprecated the order manager's add_event_pair, as the
first event it records gates the release of the arguments rather than
being a host task. Every `_manager.add_event_pair(ht_ev, ev)` is now
`_manager.add_cleanup_event(ht_ev)` followed by `_manager.add_event(ev)`,
which record the same events in the same lists.
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.22.0dev3+80.gf92811446 ran successfully.
Passed: 1491
Failed: 0
Skipped: 6

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

Coverage is 84.68% — replace-add-event-pair into drop-host-tasks-and-reuse-dpctl-deferral. No base build found for drop-host-tasks-and-reuse-dpctl-deferral.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/pull/3225/index.html

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants